package cn.dengta.webapp.user.vo;

import cn.dengta.webapp.base.vo.AbstractVO;
import lombok.Getter;
import lombok.Setter;
import me.codeplayer.util.X;
import org.aspectj.weaver.loadtime.Agent;

@Getter
@Setter
public class AgentAnchorInfoVO extends AbstractVO<Agent> {

	/** 昨日新增主播数 */
	public Long yesterdayAddCount;
	/** 昨日登录主播数 */
	public Long yesterdayLoginCount;
	/** 主播总数 */
	public Long totalCount;
	/** 昨日主播在线时长 */
	public Long yesterdayLoginTime;

	public AgentAnchorInfoVO initCount(AgentAnchorInfoVO vo) {
		this.yesterdayAddCount = X.expectNotNull(vo.yesterdayAddCount, 0L);
		this.yesterdayLoginCount = X.expectNotNull(vo.yesterdayLoginCount, 0L);
		this.totalCount = X.expectNotNull(vo.totalCount, 0L);
		this.yesterdayLoginTime = X.expectNotNull(vo.yesterdayLoginTime, 0L);
		return this;
	}

	public String getYesterdayLoginTime_() {
		return yesterdayLoginTime != null ? String.format("%.2f", yesterdayLoginTime / 3600F) : null;
	}

}
